from datetime import datetime
import random


def gen_trans_id():
    '''生成交易流水'''
    now = datetime.now()
    str_date = now.strftime('%Y%m%d%H%M%S%F')
    return str_date + str(random.randint(1000, 9999))